<?php
include('../inc/parseCountryCode.class.php');

$xmlPath = '../inc/countryCode.xml';
$regions = parseCountryCode::parseXml($xmlPath, true);

$region = $_GET['region'];
/*
$sub = isset($_GET['sub']) ? $_GET['sub'] : '';
if($sub){
	$r = getStatsClass::getCountryByRegionAndSub($region, $sub);
}else{
	$r = getStatsClass::getRegion($region);
}
*/
//
//$r = getStatsClass::getRegion($region);

$r = $regions[$region];
echo json_encode($r);




/*
$q = isset($_GET['q']) ? $_GET['q'] : '';
$countrys = explode(',', $q);

$len = count($countrys);
$var = substr($countrys[$len-1], 0, 1);

$r = isset(countryClass::$$var) ? countryClass::$$var : array();
$keys = array_keys($r);
$values = array_values($r);
foreach($values as $k=>$v){
	$values[$k] = ucwords(strtolower($v));
}
echo implode("\r\n", $values);
*/
?>